package com.ag.dgm.dao;

import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

public class TbEventDAOczy extends HibernateDaoSupport{
	private Session session;
	/*
	 * czy , 保存事件原因
	 */
	public String savePlanReason(String eid,String textarea){ 
		String hql = "update TbEvent t set t.planReason= '"+textarea+"' where t.EId=" + eid;
		session = (Session) this.getSessionFactory().openSession();
		try {
			Transaction tx = session.beginTransaction();
			Query query = session.createQuery(hql);
			int count = query.executeUpdate();
			tx.commit();
		} catch (HibernateException e) {
			System.out.println(e.toString());
		} finally {
			session.close();
		}
		
		
		return null;
	}

}
